﻿Imports GBDZafiro
Imports System.Data.Common

Public Class ModuloPerfil
    Public Shared Function consxPerfil(perfil As GBDZafiro.Perfil) As DataTable
        Dim conexion As New ConexionBD.ConexionBD()
        Dim dtConsulta As New DataTable
        If conexion.Conectar() Then
            Dim sentencia As String
            sentencia = "select * from modulo where modulo.cod_modulo in ( select menu.cod_modulo from menu " + _
                "inner join menu_perfil on menu.cod_menu=menu_perfil.cod_menu " + _
                "where perfil=@PERFIL GROUP BY menu.cod_modulo)"
            conexion.ParametroEntrada = New List(Of DbParameter)
            conexion.ParametroEntrada.Add(ConexionBD.ConexionBD.ParamInString(conexion, perfil.perfil, "PERFIL"))
            dtConsulta = conexion.Consulta(sentencia)
            conexion.Desconectar()
        End If
        Return dtConsulta
    End Function
End Class
